/*class Student implements Comparable<Student>{
    String name;
    int age;
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    @Override
    public int compareTo(Student o) {
        //根据年龄比较
        if (this.age > o.age) {
            return this.age - o.age;
        } else {
            return o.age - this.age;
        }
    }
}
public class JavaSE731 {
    public static void main(String[] args) {
        Student student = new Student("lisi",18);
        Student student1 = new Student("zhangsan",22);
        System.out.println(student.compareTo(student1));
    }
}*/

/*import java.util.Comparator;

class Student {
    String name;
    int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class AgeCompare implements Comparator<Student> {
    @Override
    public int compare(Student o1, Student o2) {
        return o1.age - o2.age;
    }
}
public class JavaSE731 {
    public static void main(String[] args) {
        Student student = new Student("zs",14);
        Student student1 = new Student("ws",22);
        AgeCompare ageCompare = new AgeCompare();
        System.out.println(ageCompare.compare(student,student1));
    }
}*/

/*
class Ban {
    int num = 19;

    @Override
    public String toString() {
        return "Ban{" +
                "num=" + num +
                '}';
    }
}
//浅拷贝
class Student implements Cloneable{
    String name;
    int age;
    Ban ban = new Ban();

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                "," + ban +
                '}';
    }
}
public class JavaSE731 {
    public static void main(String[] args) throws CloneNotSupportedException{
        Student student = new Student("zs",14);
        Student student1 = (Student) student.clone();
        student.ban.num = 99;
        System.out.println(student);
        System.out.println(student1);
    }
}
*/


/*class Ban implements Cloneable{
    int num = 19;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Ban{" +
                "num=" + num +
                '}';
    }
}
//深拷贝
class Student implements Cloneable{
    String name;
    int age;
    Ban ban = new Ban();

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student student = (Student) super.clone();
        student.ban = (Ban) this.ban.clone();
        return student;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                "," + ban +
                '}';
    }
}
public class JavaSE731 {
    public static void main(String[] args) throws CloneNotSupportedException{
        Student student = new Student("zs",14);
        Student student1 = (Student) student.clone();
        student.ban.num = 99;
        System.out.println(student);
        System.out.println(student1);

    }
}*/

/*public class JavaSE731 {
    static class Student {

    }
}*/
/*public class JavaSE731 {
    public void func() {
        class A {

        }
    }
}*/
class Father {
    public void test() {
        System.out.println("父类");
    }
}
public class JavaSE731 {
    public static void main(String[] args) {
        Father father = new Father(){
            @Override
            public void test() {
                super.test();
            }
        };
    }
}
